Conventionally, there is a technique of performing communication between apparatuses, using near field communication such as NFC (Near Field Communication). In near field communication, in accordance with the fact that a communication target, which is another communication apparatus, has come close to a communication apparatus, the communication target is specified, and communication is started.
In conventional near field communication, while a communication target, which is another communication apparatus, is close to a communication apparatus, the communication apparatus continues to transmit radio waves to detect whether or not the communication target has moved away. This leads to large power consumption.
Therefore, the present application discloses a storage medium having stored therein a communication program capable of reducing power consumption in near field communication, and an information processing apparatus, a communication system, and a communication method that are capable of reducing power consumption in near field communication.
(1)
An example of a storage medium according to the present specification is a non-transitory computer-readable storage medium having stored therein a communication program to be executed by a computer of an information processing apparatus having a communication section configured to perform near field communication, the communication program causing the computer to execute performing communication and confirmation. The computer performs data communication with a communication target present near the communication section, using the communication section. After the data communication, the computer causes the communication section to intermittently transmit radio waves for confirming presence of the communication target having performed the data communication.
(2)
The communication program may further cause the computer to execute, if the presence of the communication target near the communication section has been confirmed, acquiring identification information of the communication target from the communication target, and determining, using the acquired identification information, whether or not the communication target having performed the data communication has been changed.
(3)
While a result of the determination is negative, the radio waves for confirming the presence of the communication target having performed the data communication may continue to be intermittently transmitted.
(4)
The communication program may further cause the computer to execute, if a result of the determination is affirmative, notifying an application executed by the information processing apparatus that the communication target having performed the data communication has been changed.
(5)
In response to the fact that the data communication between the information processing apparatus and the communication target present near the communication section has ended, radio waves for the data communication may be temporarily stopped regardless of whether or not the communication target having performed the data communication is present at a position where the communication target can communicate with the information processing apparatus.
(6)
After the radio waves for the data communication have been temporarily stopped, the communication section may intermittently transmit the radio waves for confirming the presence of the communication target having performed the data communication.
(7)
As the data communication, data may be read from and/or written to the communication target present near the communication section. After the reading and/or the writing of the data has ended, an operation of intermittently transmitting the radio waves may be started.
(8)
In accordance with an instruction from an application executed by the information processing apparatus, data communication with the communication target present near the communication section may be performed. An operation of intermittently transmitting the radio waves may be started regardless of the instruction from the application.
(9)
If the instruction has been given by the application during the operation of intermittently transmitting the radio waves, the transmission operation may be stopped. In response to the stoppage of the transmission operation and in accordance with the instruction from the application, the data communication may be performed anew with the communication target having performed the data communication.
(10)
The communication program may further cause the computer to execute, if the presence of the communication target has not been confirmed, notifying the application that the communication target has disappeared.
(11)
The application may not be notified of connection and disconnection of communication caused by the operation of intermittently transmitting the radio waves.
(12)
The communication program may further cause the computer to execute sensing the presence or absence of the communication target present near the communication section at first time intervals, using the radio waves. In this case, if the communication target has been sensed, data communication may be performed with the sensed communication target. The communication section may transmit the radio waves at second time intervals different from the first time intervals after the data communication.
(13)
Another example of a storage medium according to the present specification is a non-transitory computer-readable storage medium having stored therein a communication program to be executed by a computer of an information processing apparatus having a communication section configured to perform near field communication, the communication program causing the computer to execute performing communication and confirmation. In accordance with an instruction from an application executed by the information processing apparatus, the computer performs data communication with a communication target present near the communication section, using the communication section. By causing the communication section to intermittently transmit radio waves regardless of the instruction from the application, the computer confirms that the communication target having performed the data communication is present at a position where the communication target can communicate with the information processing apparatus.
It should be noted that the present specification discloses an information processing apparatus including functions equivalent to those of the information processing apparatus according to the above configurations (1) through (13), and discloses a communication system including the communication target and the information processing apparatus according to the above configurations (1) through (13). Further, the present specification discloses a communication method to be performed by the information processing apparatus according to the above configurations (1) through (13).
These and other objects, features, aspects and advantages of the exemplary embodiments will become more apparent from the following detailed description of the exemplary embodiments when taken in conjunction with the accompanying drawings.